package cn.hg.jbsa.admin.controller;

import org.apache.shiro.SecurityUtils;

import com.jfinal.aop.Before;
import com.jfinal.core.NotAction;

import cn.hg.jboot.core.controller.BaseController;
import cn.hg.jbsa.admin.interceptor.JbsaAuthInterceptor;
import cn.hg.jbsa.admin.interceptor.JbsaLogInterceptor;
import cn.hg.jbsa.admin.model.JbsaAdmin;

/**
 * @author 胡高
 * @date 2022/01/13
 */
@Before({JbsaAuthInterceptor.class, JbsaLogInterceptor.class})
public abstract class BaseJbsaAdminController extends BaseController {

    @NotAction
    public JbsaAdmin getCurrentAdmin() {
        return (JbsaAdmin) SecurityUtils.getSubject().getPrincipal();
        //        return this.getSessionAttr(JbsaConstants.CACHE_NAME_ADMIN);
    }
}
